﻿
@{
    ViewBag.Title = "Login";
    Layout = "~/Views/Shared/_LayoutLandRHome.cshtml";
}
@* 基本布局 *@
<link href="~/LandR/css/grid.css" rel="stylesheet" />
<link href="~/LandR/css/LandR.css" rel="stylesheet" />
<div class="neirong grid">
    <div class="kongjian grid-cell-2">
        <div class="kjwenzhi">
            <div class="kjtitle">
                用户登录
            </div>
            @using (Html.BeginForm("Login", "Main", FormMethod.Post))
            {
                <div class="kjB">
                    手机号：@Html.TextBox("Phone")
                </div>
                <div class="kjB">
                    密&nbsp;&nbsp;&nbsp;码：@Html.Password("Password")
                </div>
                <div class="kjbyzm">
                    验证码：<input class="tzmsrk" type="text" style="width:100px" name="name" value="" placeholder="不区分大小写" /><canvas id="canvas" width="100" height="43"></canvas>
                </div>
                <div class="kjB">
                    <input type="submit" name="btn" value=" 登录" class="btn" />
                </div>
            }
        </div>
    </div>
    <div class="tishi grid-cell-1">
        <div class="tishititleA">友情提示</div>
        <div class="tishititleB">1.保存您的个人资料</div>
        <div class="tishititleB">2.收藏您关注的商品</div>
        <div class="tishititleB">2.订阅本店商品信息</div>
        <div class="tishititleB">2.本网站受法律保护</div>
    </div>
</div>
@* 验证码 *@
<script src="~/LandR/js/code.js"></script>
<script src="~/LandR/js/jquery.min.js"></script>
<script>
    $(function () {
        code_draw();
        // 点击后刷新验证码
        $("#canvas").on('click', function () {
            code_draw();
        })

        $(".btn").on('click', function () {
            // 将输入的内容转为大写，可通过这步进行大小写验证
            var val = $(".input-val").val().toLowerCase();
            // 获取生成验证码值
            var num = $('#canvas').attr('data-code');
            if (val == '') {
                alert('请输入验证码！');
            } else if (val == num) {
                alert('提交成功！');
                $(".input-val").val('');
                draw(show_num);

            } else {
                alert('验证码错误！请重新输入！');
                $(".input-val").val('');
                draw(show_num);
            }
        })
    })
</script>
